//
//  DKAuthCertificationView.m
//  DanKU
//
//  Created by 吴斌 on 2023/10/29.
//

#import "DKAuthCertificationView.h"

@implementation DKAuthCertificationView
-(instancetype)init{
    if(self == [super init]){
        self.backgroundColor = DK_Hex(@"#4566FF");
        self.layer.cornerRadius = DK_IsWidthScale(25);
        self.clipsToBounds = YES;
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    UIImageView * dk_AuthCertificationImgView = [[UIImageView alloc] init];
    dk_AuthCertificationImgView.image = DK_GetImage(@"dk_AuthCamera");
    dk_AuthCertificationImgView.userInteractionEnabled = YES;
    [self addSubview:dk_AuthCertificationImgView];
    [dk_AuthCertificationImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@(DK_IsWidthScale(17)));
        make.left.equalTo(@(DK_IsWidthScale(39)));
        make.width.equalTo(@(DK_IsWidthScale(16)));
        make.height.equalTo(@(DK_IsWidthScale(16)));
    }];
    UILabel * dk_AuthFaceLab = [[UILabel alloc] init];
    dk_AuthFaceLab.textColor = DK_Hex(@"#333333");
    dk_AuthFaceLab.font = DK_FONT_Medium(14);
    dk_AuthFaceLab.text = @"Certification to get the loan";
    [self addSubview:dk_AuthFaceLab];
    [dk_AuthFaceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(dk_AuthCertificationImgView.mas_right).offset(DK_IsWidthScale(10));
        make.top.equalTo(@(DK_IsWidthScale(0)));
        make.bottom.equalTo(@(DK_IsWidthScale(0)));
    }];
    UIButton * dk_AuthFaceCertificationBtn = [[UIButton alloc] init];
    [dk_AuthFaceCertificationBtn addTarget:self action:@selector(authFaceCertification) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:dk_AuthFaceCertificationBtn];
    [dk_AuthFaceCertificationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(@(DK_IsWidthScale(0)));
    }];
}
- (void)authFaceCertification{
    if(self.CertificationBlock){
        self.CertificationBlock();
    }
}
@end
